import router from './router';
// import store from './store';
// import { Notify } from 'quasar';

router.beforeEach((to, from, next) => {
  const local = localStorage.getItem('_i');
  if (local) {
    console.log(1)
    const info = JSON.parse(local);
    if ('uid' in info) {
      console.log(2)
      if (to.path === '/login') {
        console.log(3)
        next({ path: '/' });
      } else {
        console.log(4)
        next();
      }
    } else {
      console.log(5)
      next({path: '/login'});
    }
  } else {
    console.log(6)
    next({path: '/login'})
  }
});
